package com.museum.controller;


import com.alibaba.fastjson.JSONObject;
import com.museum.base.BaseApiService;
import com.museum.base.BaseResponse;
import com.museum.controller.APi.Register3ControllerAPI;
import com.museum.controller.APi.RegisterControllerAPI;
import com.museum.entity.DO.ColRegister;
import com.museum.entity.DTO.ColQuery;
import com.museum.entity.DTO.CommitCol;
import com.museum.service.impl.RegisterClueService2Impl;
import com.museum.service.impl.RegisterClueService3Impl;
import com.museum.service.impl.RegisterClueServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yznl
 * @since 2021-03-10
 */
@RestController
@RequestMapping("/registerEnd")
public class ColRegister3Controller extends BaseApiService<JSONObject> implements Register3ControllerAPI {
    @Autowired
    private RegisterClueService3Impl confirmService;

    @Override
    public BaseResponse<JSONObject> ClueControllerAPI(long current, long limit, ColQuery queryCol) {
        JSONObject json = confirmService.getAllColByPage(current,limit,queryCol);
        return setResultSuccess(json);
    }

    @Override
    public BaseResponse<JSONObject> ConfirmcommitCol(CommitCol commitCol, HttpServletRequest request) {
        int result =  confirmService.commitCol(commitCol,request);
        if(result>0){
            return setResultSuccess("审核完成");
        }else{
            return setResultError("审核失败,系统错误");
        }
    }
}
